package com.hospital.Entity;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wangjun on 2015/6/11.
 */
public class Region {
    private int RegionId;
    private String Name;
    private int ProvinceId;
    private String Province;
    private int CitySequence;
    private  int ProvinceSeqence;


    public int getCitySequence() {
        return CitySequence;
    }

    public void setCitySequence(int citySequence) {
        CitySequence = citySequence;
    }


    public int getProvinceSeqence() {
        return ProvinceSeqence;
    }

    public void setProvinceSeqence(int provinceSeqence) {
        ProvinceSeqence = provinceSeqence;
    }
    private List<Region> SubRegions = new ArrayList<Region>();

    public int getRegionId() {
        return RegionId;
    }

    public void setRegionId(int regionId) {
        RegionId = regionId;
    }

    public String getName() {
        return Name;
    }

    public void setName(String name) {
        Name = name;
    }

    public List<Region> getSubRegions() {
        return SubRegions;
    }

    public void setSubRegions(List<Region> subRegions) {
        SubRegions = subRegions;
    }

    public int getProvinceId() {
        return ProvinceId;
    }

    public void setProvinceId(int provinceId) {
        ProvinceId = provinceId;
    }

    public String getProvince() {
        return Province;
    }

    public void setProvince(String province) {
        Province = province;
    }

    public static Region jsonToRegion(JSONObject obj) {
        Region cate = new Region();
        try {
            cate.setRegionId(obj.getInt("RegionId"));
            cate.setName(obj.getString("Name"));
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        return cate;
    }
}
